# !/usr/bin/python3
# -*- coding: utf-8 -*-
# @Time    : 2021/10/8 17:47
# @Author  : zuodengbo
# @Email   : zuodb@amoydx.com
# @File    : const
# @Software: PyCharm

class UserStatus(object):
    disabled = 0  # 禁用
    enabled = 1  # 正常


class UserSuper(object):
    general_user = 0  # 普通用户
    super_user = 1   # 超级用户


class RoleAndAuthorityStatus(object):
    frozen = 0  # 冻结
    available = 1  # 可用


class UserJobStatus(object):
    dimission = 0  # 离职
    mission = 1  # 在职


class VerifyCodeStatus(object):
    unverified = 1
    verified = 2


class PermissionType(object):
    catalog = 1  # 目录（数据）
    menu = 2  # 菜单（页面）
    button = 3  # 按钮（操作）


class RespCode(object):
    SUCCESS = 200
    BAD_REQUEST = 400
    REQUIRE_LOGIN = 401
    FORBIDDEN = 403
    NOT_FOUND = 404
    NOT_ALLOWED = 405
    UNPROCESSABLE_ENTITY = 422
    USERNAME_ALREADY_EXISTS = 1000
    PHONE_REGISTERED = 1001
    EMAIL_REGISTERED = 1002
    USERNAME_ABANDONED = 1003
    PHONE_DISABLED = 1004
    EMAIL_DISABLED = 1005
    INVALID_PHONE = 1006
    INVALID_EMAIL = 1007
    REQUIRE_PHONE_OR_EMAIL = 1008
    USER_NOT_EXISTS = 1100
    USER_REGISTER_FAILED = 1300
    DATABASE_ERROR = 1200
    PASSWD_INCORRECT = 2000
    QUERY_FAILED = 2001
    UNKNOWN_FAILURE = 2002
    USER_ROLE_ALREADY_BOUND = 2003
    ROLE_AUTHORITY_ALREADY_BOUND = 2004
    ROLE_ALREADY_EXISTS = 2100
    ROLE_NOT_EXISTS = 2200
    AUTHORITY_NOT_EXISTS = 2300
    AUTHORITY_ALREADY_EXISTS = 2400
    SAVE_VERIFY_CODE_FAILED = 3000
    VERIFY_CODE_NOT_EXISTS = 3001
    VERIFY_CODE_EXPIRED = 3002
    VERIFY_CODE_VERIFIED = 3003
    CONNECT_EMAIL_SERVER_FAILED = 4000
    EMAIL_SERVER_LOGIN_FAILED = 4001


class DefaultConst(object):
    default_count = 0
    code_valid_time = 10
    page_num = 1
    page_size = 50
    verify_code_expired_time = 60
    token_expired_time = 28800
    time_fmt = "%Y-%m-%d %H:%M:%S"
    date_fmt = "%Y-%m-%d"
